package com.wlyuan.open.infrastructure.converter;

import com.wlyuan.core.domain.MappingIds;
import com.wlyuan.core.marker.MappingStatus;
import com.wlyuan.open.dao.entity.PushTenantDO;
import com.wlyuan.open.domain.PushTenant;
import com.wlyuan.open.domain.PushTenantId;
import com.wlyuan.open.domain.mappings.MappingPush;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

public class PushTenantConverter {
    @Mapper(imports = {
            PushTenantId.class,
    }, uses = {
            MappingStatus.class,
            MappingIds.class,
            MappingPush.class
    })
    public interface Converter {

        PushTenantDO convert(PushTenant pushTenant);

        PushTenant convert(PushTenantDO pushTenantDO);
    }

    private static final Converter CONVERTER = Mappers.getMapper(Converter.class);

    public static PushTenant convert(PushTenantDO pushTenantDO){
        return CONVERTER.convert(pushTenantDO);
    }
}
